import dva from 'dva';
import createLoading from 'dva-loading';
import './index.html';
import './index.css';
import { useRouterHistory } from 'dva/router';
import { createHashHistory } from 'history';

// 1. Initialize
// const app = dva();

// 1.1去除 hashHistory 下的 _k 查询参数
const app = dva({
  history: useRouterHistory(createHashHistory)({ queryKey: false }),
  initialState:{users:1},
});
console.log('顶层数据',app._store); // 顶部的 state 数据
// 1.2切换 history 为 browserHistory
// import { browserHistory } from 'dva/router';
// const app = dva({
//   history: browserHistory,
// });

// 2. Plugins
app.use(createLoading());

// 3. Model
app.model(require('./models/users'));

// 4. Router
app.router(require('./router'));

// 5. Start
app.start('#root');
